package com.ghf.dp2.sample;

import com.ghf.dp1.sample.Operation;
import com.ghf.dp1.sample.OptAdd;
import com.ghf.dp1.sample.OptSub;

//简单工厂
//根据活动类型创建不同的收费算法类
public class CashFactory {

    public static CashSuper createCash(String opt){
        switch (opt){
            case "正常":
                return new CashNormal();
            case "打折":
                return new CashRebate();
            default:
                return new CashNormal();
        }
    }
}
